Add endpoint for purl lookup - #1359
Conversation
6af7396 to
85d5b9d
Compare
|
@TG1999 I tried to test this new PURL lookup endpoint but cannot find the branch |
|
@TG1999 BTW, I've been doing some initial testing of our API bulk PURL search endpoint and other search endpoints/methods -- using
Unable to get this to work. The required input template differs from the structure that works in my local .py file. I tried this without success: Response: I also tried the following structure without success (but this DOES work in my local .py file AND is recommended in our RTD (https://vulnerablecode.readthedocs.io/en/latest/api.html#package-bulk-search)): Response: |
|
Does the public API UI bulk-PURL search (POST /api/packages/bulk_search/) actually work and I just can't follow directions? ;-) |
|
@johnmhoran see https://github.com/nexB/dejacode/blob/2bdb96d1fefca88e10db4c4e0c8efdcecb05864f/dejacode_toolkit/vulnerablecode.py#L69 how bulk_search API is used here |
|
@TG1999 I don't think you read my comments very closely. I already have the bulk search API working in my Python code -- but I am unable to get the Public API UI bulk search working (here: https://public.vulnerablecode.io/api/docs/), and I explained what the experience was with that. I also do not know where your lookup branch is. All of that is detailed in my comments above, including my successful .py use of this structure: |
TG1999
left a comment
There was a problem hiding this comment.
Some nits for my consideration
| """ | ||
| Return the response for exact PackageURL requested for. | ||
| """ | ||
| purl = request.data.get("purl", []) or None |
There was a problem hiding this comment.
| purl = request.data.get("purl", []) or None | |
| purl = request.data.get("purl") |
| @@ -347,6 +347,20 @@ def all(self, request): | |||
| vulnerable_purls = [str(package.package_url) for package in vulnerable_packages] | |||
There was a problem hiding this comment.
Also add bulk_lookup
85d5b9d to
2bfd25c
Compare
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
2bfd25c to
ea92b51
Compare
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
|
Added |
|
@TG1999 I've added your repo as a new remote and can now access your Based on the tests, I expected this structure to work with my local instance: However, this threw an error: Not sure why that works in your tests but not for me. Googling was unhelpful, and the variations I tried in the key 'content_type' did not resolve the error. I finally deleted that line from the and the following returned the expected list containing two duplicate I'll continue my exploration of the |
|
@TG1999 Very nice! 👍 |
fixes : #1357